<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title></title>
 <%@ include file="/common/query.jsp"%>
<script>
	$(function () {
        initData();
    });
	function save() {
		var param = $(".layui-form").serializeArray();
		postAsync("${base}/system/config/save",{json:JSON.stringify(param)},function (res) {
            layer.alert("保存成功")
			if(res.code==0){
                initData();
			}

        });
    }
    function initData() {
        postAsyncFalse("${base}/system/config/getALL",{},function (res) {
            console.log(res);
            $.each(res.data,function (index,row) {
                $('input[name='+row.name+']').val(row.value);
            });
        });
    }
</script>
</head>
<body>

<div class="layui-tab">
	<button class="layui-btn layui-btn-fluid" onclick="save()">保存</button>
	<ul class="layui-tab-title">
		<li  id="member">销售回访预警配置</li>
		<li>其他配置</li>
	</ul>
	<div class="layui-tab-content">
		<div class="layui-tab-item">
			<form class="layui-form" action="">
				<div class="layui-form-item">
					<label class="layui-form-label">预警天数</label>
					<div class="layui-input-block">
						<input type="text" name="预警天数" lay-verify="title" autocomplete="off" placeholder="请输入标题" class="layui-input">
					</div>
				</div>
				<div class="layui-form-item">
					<label class="layui-form-label">释放天数</label>
					<div class="layui-input-block">
						<input type="text" name="释放天数" lay-verify="title" autocomplete="off" placeholder="请输入标题" class="layui-input">
					</div>
				</div>
			</form>
		</div>
		<div class="layui-tab-item">其他配置</div>
	</div>
</div>
<script>

    layui.use(['element','form', 'layedit', 'laydate'], function(){
        var $ = layui.jquery
            ,element = layui.element; //Tab的切换功能，切换事件监听等，需要依赖element模块
        var form = layui.form,layedit = layui.layedit
            ,laydate = layui.laydate;
        $('#member').click();
    });
</script>
</body>
</html>